import EchartLine from '@/components/echarts/line/Line';
import { Card, Space, Row, Col } from "antd";
import { useNavigate } from 'react-router-dom';
import { userContext } from '@/store/userContext';
import { useContext } from 'react';
const Card1: any = Card

const Home = () => {
  const router = useNavigate()
  const context = useContext(userContext) as any
  console.log('home-访问全局的状态', context)
  return (<div>
    <button onClick={() => {
      sessionStorage.clear()
      router('/login')
    }}>退出</button>
    邮箱：{context.email},<br />
    手机号：{context.mobile}
    <Space direction='vertical' style={{ display: 'flex' }}>
      <Row gutter={20}>
        <Col span={8}>
          <Card1>待审核：0 人</Card1>
        </Col>
        <Col span={8}>
          <Card1>待审核：1 人</Card1>
        </Col>
        <Col span={8}>
          <Card1>待审核：2 人</Card1>
        </Col>
      </Row>
      <Row gutter={20}>
        <Col span={8}>
          <Card1>待审核：0 人</Card1>
        </Col>
        <Col span={8}>
          <Card1>待审核：0 人</Card1>
        </Col>
      </Row>
    </Space>
    <div className="h15"></div>
    <Space direction="vertical" style={{ display: 'flex' }}>
      {/* echart图表 */}
      <Card1 size="small">
        <EchartLine echartId={'echartId1'} />
      </Card1>
      {/* 本周详情 */}

      <Card1 size="small" title='本周详情'>
        本周人员统计表
      </Card1>
    </Space>
  </div>);
}

export default Home;
